import request from '@/utils/request'

// 查询商机列表（分页）
export const getBusinessListApi = (params) => request.get('/businesses', { params })

// 根据ID查询商机详情
export const getBusinessDetailApi = (id) => request.get(`/businesses/${id}`)

// 添加商机
export const addBusinessApi = (data) => request.post('/businesses', data)

// 查询商机公海池列表
export const getBusinessPoolListApi = (params) => request.get('/businesses/pool', { params })

// 分配商机
export const assignBusinessApi = (businessId, userId) => request.put(`/businesses/assign/${businessId}/${userId}`)

// 踢回公海
export const backToPoolApi = (id) => request.put(`/businesses/back/${id}`)

// 将商机转为客户
export const toCustomerApi = (id) => request.post(`/businesses/toCustomer/${id}`)

// 跟进商机
export const trackBusinessApi = (data) => request.put('/businesses', data)